<template>
  <div id="app">
    <router-view />
    <ImgReview ref="ImgReview" />
  </div>
</template>

<script>
import Bus from '@/utils/bus.js'
import ImgReview from '@/components/ImgReview/index.vue'
export default {
  name: 'App',
  metaInfo() {
    return {
      title:
        this.$store.state.settings.dynamicTitle &&
        this.$store.state.settings.title,
      titleTemplate: (title) => {
        return title
          ? `${title} - ${process.env.VUE_APP_TITLE}`
          : process.env.VUE_APP_TITLE
      }
    }
  },
  components: {
    ImgReview
  },
  created() {
    /* imgList => ['imgsrc1', 'imgsrc2'] */
    Bus.$on('openBigImg', (imgList = [], index = 0) => {
      this.$refs.ImgReview.show(imgList, index)
    })
  }
}
</script>
<style lang="scss" scoped>
#app {
  min-width: 1000px;
}
</style>
